import torch
def compare_models(file1, file2):
        params1 = torch.load(file1)
        params2 = torch.load(file2)
        print(file1)
        match = True
        for key in params1:
            if not torch.allclose(params1[key], params2[key], atol=1e-6):
                print(f"参数差异: {key}")
                match = False
        return "参数相同" if match else "参数不同"